﻿@Imports System.Collections.ObjectModel
@imports Library

@Code
    ViewData("Title") = "Index"
    Dim TaskList As Collection(Of ScheduleTask) = ScheduleTask.FindAll()
End Code

<div id="page">

    <div id="page_header" style="position:relative;">
        Schedule Tasks (@Html.ActionLink("Add Record", "create", "ScheduleTask"))
    </div>

    <div id="page_body">
            
        <div class="IE_padding_hack">

            <table class="display">
	            <tr>
		            <th></th>
		            <th>End Date</th>
		            <th>Owner</th>
		            <th>Period</th>
		            <th>Amount</th>
		            <th>Type</th>
		            <th>Remark</th>
	            </tr>
                @If TaskList.Count <> 0 Then
                    For Each item As ScheduleTask In TaskList
                        @<tr>
                            <td>@Html.ActionLink("Edit", "edit", "ScheduleTask", new With{.id = item.Id}, nothing)</td>
	                        <td>@item.EndDate.ToString("yyyy-MM")</td><td>@item.owner</td>
	                        <td>@item.Period</td><td>@item.Amount.ToString</td>
	                        <td>@item.RecordType</td><td>@item.Remark</td>  
                        </tr>
                    Next
                Else
                    @<tr><td colspan="7">No Data Now.</td></tr>
                End If
            </table>

        </div>
                    
    </div>
        
</div>

@section Scripts

<script type="text/javascript">
    $(function () {
        $("#global_nav li a").eq(4).addClass("selected");
    });
</script>

End Section